/**
 *
 */
package com.angel.io.processors.runners.exports;

import java.util.Collection;
import java.util.List;

import com.angel.io.descriptor.ExportedFileDescriptor;
import com.angel.io.exceptions.InvalidRowDataException;
import com.angel.io.factories.FileColumnsFactory;


/**
 * @author William
 *
 */
public interface ExportProcessorRunner {

	/** Run an export process for a objects' collection
	 *
	 * @param objets to exports.
	 * @return
	 * @throws InvalidRowDataException  when a row data is invalid for an error in the information.
	 */
	public ExportedFileDescriptor runProcess(Collection<?> objets) throws InvalidRowDataException;

	/** Add an alias name for a column at input stream to process. It is bidireccional, so columnName or aliasName parameters can be
	 * an input stream column. First it tests, if in the input stream there is a column with its name "columnName", it adds "aliasName" as alias for "columnName".
	 * If not, it adds an alias named "columnName" for the input stream column "aliasName".
	 *
	 *
	 * @param columnName to test add an alias.
	 * @param aliasName to test add as alias.
	 */
	public void addAliasFor(String columnName, String aliasName);

	/** Add a list' alias names to a column name. It called iteratively to addAliasFor method.
	 *
	 * @param columnName to test add a list alias names.
	 * @param aliasNames list to test add as alias.
	 */
	public void addAliasFor(String columnName, List<String> aliasNames);

	/** Add a column with a name in a specific position.
	 *
	 * @param columnName to add.
	 * @param position of the column to add.
	 */
	public void addColumn(String columnName, Integer position);

	/** Add a column at the first position. If the position there is a column it throws an ColumnRowHeaderException.
	 *
	 * @param columnName to add.
	 */
	public void addFirstColumn(String columnName);

	/** At a column at the next position of the last column added. If there is not columns added, it adds at
	 * the first position.
	 *
	 * @param columnName to add.
	 */
	public void addNextColumn(String columnName);

	/** Add columns from a file columns factory.
	 *
	 * @param fileColumnsFactory to creates all columns.
	 */
	public void addColumns(FileColumnsFactory fileColumnsFactory);
}
